package com.gabry.utils;

/**
 * Created by ShaoJie.Wu on 2017/1/11 9:46.
 * 功能：
 * <p>
 * 备注：
 */
public class StackUtil {
    private static StackUtil ourInstance = new StackUtil();

    public static StackUtil getInstance() {
        return ourInstance;
    }

    private StackUtil() {
    }
    public final void stack(){
        // 这里可以注入任意你想注入的代码
        StackTraceElement stack[] = Thread.currentThread().getStackTrace();
        System.out.println("method "+stack[4].getClassName()+"."+stack[4].getMethodName()+" call "+stack[3].getClassName()+"."+stack[3].getMethodName());
    }
}
